H5x.component("upprogress",[],function(opts){
    this.container =  opts.container;
    this.opts = opts;
    this.use("render");
    this.init();
},{
    init:function(){
        console.log(this.opts);
        this.render("tp-upprogress",this.opts);
    },

    emit:function(data){
        var self = this;
        var pro = parseInt(data.progress/data.total*100);
        self.container.find(".progress-bar").css("width",pro+"%");
        if(data.progress==data.total){
            $("#progress-amount").html("已上传完成");
        }else{
            $("#progress-amount").html(data.progress+"/"+data.total);
        }
    }
});
